package com.sy.controller;

import com.sy.dto.JsonResult;
import com.sy.entity.ClassEntity;
import com.sy.sevice.ClassService;
import com.sy.vo.AddClassVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Monkey-D-Gu
 * @version 1.0
 * @date 2020/9/14 0014 13:32
 * @usage 班级相关的控制类
 */
@RestController
@RequestMapping("classes")
public class ClassController {

    @Autowired
    private ClassService classService;

    @RequestMapping(value = "",method = RequestMethod.POST)
    public JsonResult addClass(@RequestBody ClassEntity classEntity){
        System.out.println(classEntity);
        return classService.addNewClass(classEntity);
    }
}
